package com.itheima.test3;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int[] arr = {1, 332, 43, 25, 3324, 34, 335, 4, 45, 2, 43, 52, 54};
        String str = Arrays.toString(arr);
        System.out.println(str);
        upSort(arr);
        System.out.println(Arrays.toString(arr));
    }

    private static void upSort(int[] arr) {
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if (arr[j]>arr[j+1]){
                    int temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }
        }
    }

}
